Optimal. Leaf size=48 \[ -x-\frac {2 e^{2 i a} x}{e^{2 i a}-x^2}+2 e^{i a} \tanh ^{-1}\left (e^{-i a} x\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.454, Rules used = {4588, 381, 398,
294, 213} \begin {gather*} -\frac {2 e^{2 i a} x}{-x^2+e^{2 i a}}+2 e^{i a} \tanh ^{-1}\left (e^{-i a} x\right )-x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 213
Rule 294
Rule 381
Rule 398
Rule 4588
Rubi steps
\begin {align*} \int \cot ^2(a+i \log (x)) \, dx &=\int \cot ^2(a+i \log (x)) \, dx\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 70, normalized size = 1.46 \begin {gather*} 2 \tanh ^{-1}(x (\cos (a)-i \sin (a))) (\cos (a)+i \sin (a))+\frac {-x \left (-3+x^2\right ) \cos (a)+i x \left (3+x^2\right ) \sin (a)}{\left (-1+x^2\right ) \cos (a)-i \left (1+x^2\right ) \sin (a)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 36, normalized size = 0.75
method | result | size |
risch | \(-3 x -\frac {2 x}{\frac {{\mathrm e}^{2 i a}}{x^{2}}-1}+2 \arctanh \left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{i a}\) | \(36\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 270 vs. \(2 (36) = 72\).
time = 0.30, size = 270, normalized size = 5.62 \begin {gather*} -\frac {2 \, {\left ({\left (-i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) + {\left (-i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right )\right )} x^{2} + 2 \, x^{3} - 6 \, x {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} + 2 \, {\left ({\left (i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \cos \left (2 \, a\right ) - {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) + 2 \, {\left ({\left (i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \cos \left (2 \, a\right ) - {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right ) - {\left (x^{2} {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} - {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \cos \left (2 \, a\right ) + {\left (-i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} \log \left (x^{2} + 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) + {\left (x^{2} {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} - {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \cos \left (2 \, a\right ) - {\left (i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} \log \left (x^{2} - 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right )}{2 \, {\left (x^{2} - \cos \left (2 \, a\right ) - i \, \sin \left (2 \, a\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.20, size = 72, normalized size = 1.50 \begin {gather*} -\frac {x^{3} - {\left (x^{2} - e^{\left (2 i \, a\right )}\right )} e^{\left (i \, a\right )} \log \left (x + e^{\left (i \, a\right )}\right ) + {\left (x^{2} - e^{\left (2 i \, a\right )}\right )} e^{\left (i \, a\right )} \log \left (x - e^{\left (i \, a\right )}\right ) - 3 \, x e^{\left (2 i \, a\right )}}{x^{2} - e^{\left (2 i \, a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.16, size = 42, normalized size = 0.88 \begin {gather*} - x + \frac {2 x e^{2 i a}}{x^{2} - e^{2 i a}} - \left (\log {\left (x - e^{i a} \right )} - \log {\left (x + e^{i a} \right )}\right ) e^{i a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 79 vs. \(2 (36) = 72\).
time = 0.43, size = 79, normalized size = 1.65 \begin {gather*} -\frac {x^{3}}{x^{2} - e^{\left (2 i \, a\right )}} - 2 \, {\left (\frac {\arctan \left (\frac {x}{\sqrt {-e^{\left (2 i \, a\right )}}}\right )}{\sqrt {-e^{\left (2 i \, a\right )}}} - \frac {x}{x^{2} - e^{\left (2 i \, a\right )}}\right )} e^{\left (2 i \, a\right )} + \frac {5 \, x e^{\left (2 i \, a\right )}}{x^{2} - e^{\left (2 i \, a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.19, size = 44, normalized size = 0.92 \begin {gather*} -x+2\,\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}\,\mathrm {atanh}\left (\frac {x}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )-\frac {2\,x\,{\mathrm {e}}^{a\,2{}\mathrm {i}}}{{\mathrm {e}}^{a\,2{}\mathrm {i}}-x^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________